package tienmanh.gs.goldminer.util;

import tienmanh.gs.goldminer.sprite.Hook;
import tienmanh.gs.goldminer.sprite.Object;


public class Util
{
  public int[] levelPass = { 1000, 2500, 4000, 5500, 7000, 8500, 11000, 14000, 17000, 20000, 21000, 22500, 24000, 25500, 27000, 28500, 31000, 34000, 37000, 40000, 41000, 42500, 44000, 45500, 47000, 48500, 51000, 55000, 60000, 66000 };

  public int getCenterX(Object paramGolds)
  {
    return (int)(paramGolds.getX() + paramGolds.getWidth() / 2.0F);
  }

  public int getCenterX(Hook paramHook)
  {
    return (int)(15.0F + paramHook.getX());
  }

  public int getCenterY(Object paramGolds)
  {
    return (int)(paramGolds.getY() + paramGolds.getHeight() / 2.0F);
  }

  public int getCenterY(Hook paramHook)
  {
    return (int)(15.0F + paramHook.getY());
  }

  public int getDistance(int paramInt1, int paramInt2, Object paramGolds)
  {
    return (int)Math.sqrt((paramInt1 - getCenterX(paramGolds)) * (paramInt1 - getCenterX(paramGolds)) + (paramInt2 - getCenterY(paramGolds)) * (paramInt2 - getCenterY(paramGolds)));
  }

  public int getDistance(Hook paramHook, Object paramGolds)
  {
    return (int)Math.sqrt((getCenterX(paramHook) - getCenterX(paramGolds)) * (getCenterX(paramHook) - getCenterX(paramGolds)) + (getCenterY(paramHook) - getCenterY(paramGolds)) * (getCenterY(paramHook) - getCenterY(paramGolds)));
  }

  public int getGold(int paramInt)
  {
    return this.levelPass[(paramInt - 1)];
  }

  public int getYInCircle(int paramInt1, int paramInt2, int paramInt3)
  {
    return paramInt3 + (int)Math.sqrt(Math.abs(-3600 + (paramInt1 - paramInt2) * (paramInt1 - paramInt2)));
  }
}

